{:W('Cate/header')}
{:W('Cate/left')}

<!--内容部分-->
<div class="content">
    <div class="title">
        <p>服务管理</p>
        <i class="icon-angle-right"></i>
        <p class="active">开通记录</p>
    </div>
    <div class="admin_list clearfix">
        <div class="main">
            <!--<div class="main_title">-->
                <!--<form action="{:U('open_record/open_record')}" method="get">-->
                    <!--<ul class="clearfix">-->
                        <!--<li>-->
                            <!--<span>客户名称</span>-->
                            <!--<input value="{$param.name}" maxlength="20" name="name" type="text" >-->
                        <!--</li>-->
                        <!--&lt;!&ndash;<li>&ndash;&gt;-->
                            <!--&lt;!&ndash;<span>系统订单号</span>&ndash;&gt;-->
                            <!--&lt;!&ndash;<input value="{$param.name}" maxlength="20" name="name" type="text" >&ndash;&gt;-->
                        <!--&lt;!&ndash;</li>&ndash;&gt;-->
                        <!--<li>-->
                            <!--<span style="width: 85px;">创建订单时间</span>-->
                            <!--<if condition="$param['begintime'] eq true">-->
                                <!--<input value="{$param.begintime|date='Y-m-d H:i:s',###}" readonly name="begintime" placeholder="请选择开始时间" type="text" id="begintime">-->
                                <!--<else/>-->
                                <!--<input value="" readonly name="begintime" placeholder="请选择开始时间" type="text" id="begintime">-->
                            <!--</if>-->
                        <!--</li>-->
                        <!--<li style="border:none;">-</li>-->
                        <!--<li>-->
                            <!--<if condition="$param['endtime'] eq true">-->
                                <!--<input value="{$param.endtime|date='Y-m-d H:i:s',###}" readonly name="endtime" placeholder="请选择结束时间" type="text" id="endtime">-->
                                <!--<else/>-->
                                <!--<input value="" readonly name="endtime" placeholder="请选择结束时间" type="text" id="endtime">-->
                            <!--</if>-->
                        <!--</li>-->
                        <!--<button type="submit"><img src="__PUBLIC__/images/seach.png">搜索</button>-->
                    <!--</ul>-->
                <!--</form>-->
            <!--</div>-->
            <div class="main_title">
                <form action="{:U('open_record/open_record')}" method="get">
                    <ul class="clearfix">
                        <li>
                            <span>客户名称</span>
                            <input value="{$param.name}" maxlength="20" name="name" type="text" >
                        </li>
                        <li>
                            <span>系统订单号</span>
                            <input value="{$param.sysordernum}" maxlength="20" name="sysordernum" type="text" >
                        </li>
                        <li>
                            <span style="width: 85px;">创建订单时间</span>
                            <if condition="$param['begintime'] eq true">
                                <input value="{$param.begintime|date='Y-m-d H:i:s',###}" readonly name="begintime" placeholder="请选择开始时间" type="text" id="begintime">
                                <else/>
                                <input value="" readonly name="begintime" placeholder="请选择开始时间" type="text" id="begintime">
                            </if>
                        </li>
                        <li style="border:none;">-</li>
                        <li>
                            <if condition="$param['endtime'] eq true">
                                <input value="{$param.endtime|date='Y-m-d H:i:s',###}" readonly name="endtime" placeholder="请选择结束时间" type="text" id="endtime">
                                <else/>
                                <input value="" readonly name="endtime" placeholder="请选择结束时间" type="text" id="endtime">
                            </if>
                        </li>
                        <button type="submit"><img src="__PUBLIC__/images/seach.png">搜索</button>
                    </ul>
                </form>
            </div>
            <div class="main_list">
                <div class="main_list_list user_list" style="margin-top:15px;">
                    <dl>
                        <dt>
                            <span style="width:5%;">序号</span>
                            <span style="width:14%;text-align:left;padding-left:10px;">系统订单号</span>
                            <span style="width:9%;">客户名称</span>
                            <span style="width:9%;">产品</span>
                            <span style="width:5%;">类型</span>
                            <span style="width:12%;">创建订单时间</span>
                            <span style="width:12%;">支付/开通时间</span>
                            <span style="width:7%;">支付方式</span>
                            <span style="width:7%;">订单状态</span>
                            <span style="width:7%;">原价</span>
                            <span style="width:7%;">应付金额</span>
                            <span style="width:5%;">操作</span>
                        </dt>
                        <volist name="array['records']" id='row' key="k">
                        <dd>
                            <span style="width:5%;">{$k}</span>
                            <span style="width:14%;text-align:left;padding-left:10px;">{$row['sysordernum']}</span>
                            <span style="width:9%;">{$row['companyname']}</span>
                            <span style="width:9%;">
                            <if condition="$row['servicetype'] eq 0">
                                                云视频-免费测试
                                    <elseif condition="$row['servicetype'] eq 1"/>
                                                云视频-通道授权
                                </if>
                            </span>
                            <span style="width:5%;">
                            <if condition="$row['ordertype'] eq 0">
                                                新购
                                    <elseif condition="$row['ordertype'] eq 1"/>
                                                续费
                                    <elseif condition="$row['ordertype'] eq 2"/>
                                                升级
                                    <elseif condition="$row['ordertype'] eq 3"/>
                                                免费
                                </if>
                            </span>
                            <span style="width:12%;">{$row['ordertime']|date="Y-m-d H:i:s",###}</span>
                            <span style="width:12%;">{$row['paytime']|date="Y-m-d H:i:s",###}</span>
                            <span style="width:7%;">
                            <if condition="$row['paymentmethod'] eq 0">
                                                线下支付
                                    <elseif condition="$row['paymentmethod'] eq 1"/>
                                                支付宝
                                    <elseif condition="$row['paymentmethod'] eq 2"/>
                                                微信
                                </if>
                            </span>
                            <span style="width:7%;">
                            <if condition="$row['orderstatus'] eq 0">
                                                支付成功
                                    <elseif condition="$row['orderstatus'] eq 1"/>
                                                支付失败
                                    <elseif condition="$row['orderstatus'] eq 2"/>
                                                未支付
                                    <elseif condition="$row['orderstatus'] eq 3"/>
                                                已关闭
                            </if>
                            </span>
                            <span style="width:7%;">￥{$row['purchaseprice']}</span>
                            <span style="width:7%;">￥{$row['payprice']}</span>
                            <span style="width:5%;"><a href="{:U('open_record/record_details',array('sysordernum'=>$row['sysordernum']))}">详情</a></span>
                        </dd>
                        </volist>
                    </dl>
                </div>
            </div>
            <div class="fy" id="page"></div>
        </div>
    </div>
</div>
<!--弹框-->
<!---->
<div class="hk"></div>
<div class="add_group open_record">
    <div class="add_group_title">
        <img src="__PUBLIC__/images/i_guanbi.png" class="icon-remove">开通服务
    </div>
    <div class="add_group_center">
        <ul>
            <li>
                    <span>
                        <i>*</i>客户名称：
                    </span>
                <img src="__PUBLIC__/images/i_xiala.png" class="sj icon-sort-down">
                <input value="" name="companyid" class="yh_list" placeholder="请选择客户名称" readonly data-cid="" type="text">
                <div class="list" style="overflow-y:scroll;max-height: 180px;">
                    <ul class="active"></ul>
                </div>
            </li>
            <li>
                    <span>
                        <i>*</i>收费模式：
                    </span>
                <img src="__PUBLIC__/images/i_xiala.png" class="sj icon-sort-down">
                <select name="paymode">
                    <option value="">请选择收费模式</option>
                    <option value="0">免费测试</option>
                    <option value="1">通道授权</option>
                </select>
            </li>
            <li>
                    <span>
                        <i>*</i>服务时间：
                    </span>

                <img src="__PUBLIC__/images/i_xiala.png" class="sj icon-sort-down">
                <select name="serviceduration">
                    <option value="">请选择服务时间</option>
                    <option value="0">3天</option>
                    <option value="1">1个月</option>
                    <option value="2">6个月</option>
                    <option value="3">1年</option>
                    <option value="4">2年</option>
                </select>
            </li>
            <li>
                    <span>
                        <i>*</i>服务数量：
                    </span>
                <input value="" name="servicecount" type="text">
            </li>
        </ul>
    </div>
    <div class="add_group_btn">
        <button>确定</button>
        <button>取消</button>
    </div>
</div>
</body>
<script>
    layui.use('laydate', function() {
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#begintime', //指定元素
            format: 'yyyy-MM-dd HH:mm:ss', //日期格式
            type:'datetime',
        });

        laydate.render({
            elem: '#endtime', //指定元素
            format: 'yyyy-MM-dd HH:mm:ss', //日期格式
            type:'datetime',
        });
    });
    // 分页
    layui.use('laypage', function(){
        var laypage = layui.laypage;
        //执行一个laypage实例
        laypage.render({
            elem: 'page'
            ,count: "<?php echo $totnum; ?>"
            ,limit: "<?php echo $pagecount; ?>"
            ,layout: ['prev', 'page', 'next', 'limit', 'skip']
            ,curr:function(){
                var page = location.search.match(/pageid=(\d+)/);
                return page ? page[1] : 1;
            }()
            ,jump: function(obj,first){  //点击页码出发的事件
                if(first!=true){  //是否首次进入页面
                    var sysordernum = "<?php echo $param['sysordernum']; ?>";
                    var name = "<?php echo $param['name']; ?>";
                    var begintime = "<?php echo $param['begintime']; ?>";
                    if(begintime){
                        begintime = "<?php echo date('Y-m-d H:i:s',$param['begintime']); ?>";
                    }
                    var endtime = "<?php echo $param['endtime']; ?>";
                    if(endtime){
                        endtime = "<?php echo date('Y-m-d H:i:s',$param['endtime']); ?>";
                    }
                    var _url = "/open_record/open_record?pageid="+obj.curr+"&pagecount="+obj.limit;
                    if( sysordernum || name || begintime || endtime ){
                        _url = "/open_record/open_record?pageid="+obj.curr+"&pagecount="+obj.limit+"&sysordernum="+sysordernum+"&begintime="+begintime+"&endtime="+endtime+"&name="+name;
                    }
                    window.location.href = _url;
                }
            }
        });
    });
</script>
</html>